package controller;

import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class MemberContoller extends MultiActionController{
	
	public ModelAndView adminLogin(HttpServletRequest request, HttpServletResponse response) throws Exception{
		
		String adminMail=request.getParameter("mail");
		String adminPass=request.getParameter("pass");
		
		Properties adminConfig=new Properties();
		
		adminConfig.load(getServletContext().getResourceAsStream("WEB-INF/classes/config/adminConfig.properties"));
		
		if(adminMail.equals(adminConfig.get("adminMail")) && adminPass.equals(adminConfig.get("adminPass"))){
			return new ModelAndView("redirect:index.do?command=menu");
		}else{
			return new ModelAndView("redirect:index.do?command=index");
		}
	}
}
